
//#include <stdio.h>
//#include <string>
#include "com_invokecfunc.h"
#include <Windows.h>
#include <process.h>

#ifdef __cplusplus
extern "C" {
#endif

JNIEXPORT int JNICALL Add(int i, int j)
{
	return i + j;
}

JNIEXPORT int JNICALL Sub(int i, int j)
{
	return i - j;
}
pCall g_pcall;
unsigned int call(void*){

	char * p = new char[100];

	memcpy(p, "asdfasdfasd", 6);

	Sleep(5000);

	g_pcall(p, 6);

	delete[] p;


	return 1;
}
JNIEXPORT int JNICALL Get(int* i, int* j, pCall pcall)
{
	*i = 10;
	*j = 11;

	g_pcall = pcall;
	
	_beginthreadex(NULL,0, call, NULL, 0, NULL);

	return 1;
}

#ifdef __cplusplus
}
#endif